package com.flyco.modules.system.service.impl;

import com.flyco.common.util.MailServiceUtil;
import com.flyco.modules.system.entity.SysMail;
import com.flyco.modules.system.mapper.SysMailMapper;
import com.flyco.modules.system.service.ISysMailService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 邮件表
 * @Author: flyco
 * @Date:   2023-07-03
 * @Version: V1.0
 */
@Service
public class SysMailServiceImpl extends ServiceImpl<SysMailMapper, SysMail> implements ISysMailService {

    public void sendMail(SysMail mail){

        save(mail);

        //调用发送邮件接口
        MailServiceUtil.send(mail.getReceive(),mail.getSubject(),mail.getContent(),mail.getCc(),mail.getBcc());

    }

}
